namespace EventBus
{
    /// <summary>
    /// 同步发送事件
    /// </summary>
    public partial class EventBusImpl
    {
        public bool Broadcast(object sender, string eventName)
        {
            var broadcast  = GetOrCreateBroadcast(eventName);
            return broadcast .BroadcastAction<int, int, int, int, int, int, int, int>(eventName, 0, default,
                default, default, default, default, default, default, default);
        }

        public bool Broadcast<T1>(object sender, string eventName, T1 arg1)
        {
            var broadcast  = GetOrCreateBroadcast(eventName);
            return broadcast .BroadcastAction<T1, int, int, int, int, int, int, int>(eventName, 1, arg1,
                default, default, default, default,
                default, default, default);
        }

        public bool Broadcast<T1, T2>(object sender, string eventName, T1 arg1, T2 arg2)
        {
            var broadcast  = GetOrCreateBroadcast(eventName);
            return broadcast .BroadcastAction<T1, T2, int, int, int, int, int, int>(eventName, 2, arg1, arg2,
                default, default, default,
                default, default, default);
        }

        public bool Broadcast<T1, T2, T3>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3)
        {
            var broadcast  = GetOrCreateBroadcast(eventName);
            return broadcast .BroadcastAction<T1, T2, T3, int, int, int, int, int>(eventName, 3, arg1, arg2,
                arg3, default, default,
                default, default, default);
        }

        public bool Broadcast<T1, T2, T3, T4>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
        {
            var broadcast  = GetOrCreateBroadcast(eventName);
            return broadcast .BroadcastAction<T1, T2, T3, T4, int, int, int, int>(eventName, 4, arg1, arg2,
                arg3, arg4, default,
                default, default, default);
        }

        public bool Broadcast<T1, T2, T3, T4, T5>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4,
            T5 arg5)
        {
            var broadcast  = GetOrCreateBroadcast(eventName);
            return broadcast .BroadcastAction<T1, T2, T3, T4, T5, int, int, int>(eventName, 5, arg1, arg2,
                arg3, arg4, arg5,
                default, default, default);
        }

        public bool Broadcast<T1, T2, T3, T4, T5, T6>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4,
            T5 arg5, T6 arg6)
        {
            var broadcast  = GetOrCreateBroadcast(eventName);
            return broadcast .BroadcastAction<T1, T2, T3, T4, T5, T6, int, int>(eventName, 6, arg1, arg2, arg3,
                arg4, arg5,
                arg6, default, default);
        }

        public bool Broadcast<T1, T2, T3, T4, T5, T6, T7>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3,
            T4 arg4,
            T5 arg5, T6 arg6, T7 arg7)
        {
            var broadcast  = GetOrCreateBroadcast(eventName);
            return broadcast .BroadcastAction<T1, T2, T3, T4, T5, T6, T7, int>(eventName, 7, arg1, arg2, arg3,
                arg4, arg5,
                arg6, arg7, default);
        }

        public bool Broadcast<T1, T2, T3, T4, T5, T6, T7, T8>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3,
            T4 arg4,
            T5 arg5, T6 arg6, T7 arg7, T8 arg8)
        {
            var broadcast  = GetOrCreateBroadcast(eventName);
            return broadcast .BroadcastAction<T1, T2, T3, T4, T5, T6, T7, T8>(eventName, 8, arg1, arg2, arg3,
                arg4, arg5,
                arg6, arg7, arg8);
        }
    }
}